<?php
include(dirname(__FILE__).'/mpdf.php');
//include($_SERVER['DOCUMENT_ROOT'].'./wp-config.php');


$mpdf=new mPDF('win-1252','A4','','',15,10,16,10,10,10);//A4 page in portrait for landscape add -L.
$mpdf->SetHeader('|Your Header here|');
$mpdf->setFooter('{PAGENO}');// Giving page number to your footer.
$mpdf->useOnlyCoreFonts = true;    // false is default
$mpdf->SetDisplayMode('fullpage');
// Buffer the following html with PHP so we can store it to a variable later
ob_start();
?>
        
        <link href="css/bootstrap.min.css" rel="stylesheet"/>
        <link href="css/jumbotron-narrow.css" rel="stylesheet"/>
        
        <div class="container">

        <?php
        echo $_POST['html-data'];
        ?>
		
        </div>

    <?php
		include($_SERVER['DOCUMENT_ROOT'].'./wp-blog-header.php');
		$current_user = wp_get_current_user();
		echo $current_user->ID;
		die();
		echo "<p style='text-align: center'>Date: " . date('d-m-Y H:m:s') . "</p>";
		echo "<p style='text-align: center'>Address: " . $current_user->user_firstname . "</p>";

$html = ob_get_contents();
ob_end_clean();
// send the captured HTML from the output buffer to the mPDF class for processing
$mpdf->WriteHTML($html);
//$mpdf->SetProtection(array(), 'user', 'password'); uncomment to protect your pdf page with password.
$mpdf->Output();
exit;
    